home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
fileat.zip
/
FILEATTR.DOC
< prev
Wrap
Text File
|
1993-01-04
|
5KB
|
102 lines
FILE ATTRIBUTE UTILITY
Version 4.0
November 30, 1987
by Steve Trace
OPUS Net 157/1
FA allows you to view and manipulate your file attributes. Like DOS's 3.x
ATTRIB program you can set files to be Read Only which prevents accidental
erasure however it also allows you to mark or unmark a file as Hidden, System
or Archive as well.
FA is very similar to Norton's Utility FA and even more like Charles Petzold's
ATTR published in the June 10, 1986 PC Magazine. In fact the syntax and
capabilities are identical to ATTR. The main reason for my writing of this
utility is that I failed to get ATTR to run even after checking my input of the
published Assembly Program 5 times. FA was written in Turbo Pascal so is much
larger than the 625 bytes of the ATTR and runs a bit slower but IT WORKS!
However thanks to Charles' excellent article I was able to create this program
and make sub-directories disappear. Hidden programs but not system programs
may be run from the DOS prompt with DOS 3.x but not 2.x. A utility program is
included to run hidden programs under DOS 2.x.
Possible Uses:
Read-Only
The use of this parameter allows you to protect files from being deleted,
or written over. However you can always reverse your setting of this
attribute so you can update a file or install a newer version of a
program. Excellent for preventing erasure of program files or important
data files. The major problem is you must remove the Read-Only or copy
file under another name to update data files.
Archive
All files are set as Archive when newly created or updated. This allows
DOS's BACKUP command with the /M switch to backup only new or updated
files. On occasion you may have no need to backup newly created files.
Simply turn off this attribute for selected files prior to backing up
your hard disk.
Hidden
This parameter if set (+) will hide your files from searches using DIR,
COPY, DEL ect. Handy for hiding sub-directories and still allows you to
change into them using DOS's CD command. I've include another program EX
that allows you to execute hidden programs under DOS 2.x. Hidden but not
system program files may be executed as usual under DOS 3.x. EX syntax
is as follows:
A>EX 123.COM
Note that the extension must be included for the program to execute.
Also you may not pass parameters with your program. (ie, A>EX FA.EXE *.*)
Under DOS 2.x EX.EXE may not be hidden.
System
Basically the same as Hidden.
Syntax
[d:][path\]FA [options] [d:][path\]filespec
options:
+ : Turns Attribute On
- : Turns Attribute Off
+A or -A : Archive Attribute Switched
+H or -H : Hidden Attribute Switched
+S or -S : System Attribute Switched
+R or -R : Read-Only Attribute Switched
If entered without any parameters you will receive a syntax error message
and the proper syntax. The filespec is required and it may contain
wildcards * and ?. If issued without any switching Parameters (ie, -A +H)
you merely receive a listing of all files, including hidden and system,
with their current attribute settings.
Version 1 would give an error using DOS 3.x as CHMOD gave a return code
identical to the file's attribute value. This caused an abort whenever
a file was marked as hidden only or system only. Version 2 corrects this
by ignoring the error return code. While this seems drastic, the only
valid codes under 2.x were file not found or path not found. These errors
are handled when the directory search is made, so why duplicate?
Version 2 is unmodified in version 2a. The only change is the documentation
which indicates hidden but not system program files may be executed as
usual under DOS 3.x.
Version 4 is an upgrade to Turbo Pascal 4.0, has an improved path message
and improved error messages. As a result of using 4.0 the executable and
source file sizes have been reduced. Even though FA.EXE is smaller than
FA.COM under Turbo Pascal 3.0, use of the original source run against the
Turbo Pascal 4.0 utility UPGRADE.EXE produced an even smaller file. The
only reason I can determine is that my own FindFirst, FindNext and CHMOD
functions and procedures generate tighter code than Borland's FindFirst,
FindNext and SetFAttr. Hard to believe since I only used the msDos(regs)
routine and not assembly language.